<!DOCTYPE html>
<html lang="zh-CN-Hans">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <title>发布信息</title>
    <link rel="stylesheet" type="text/css" href="/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="/layui/common.css">
    <script type="text/javascript" src="/static/Easyui/jquery.min.js"></script>
    <link href="/ueditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="/ueditor/umeditor.min.js"></script>
    <script type="text/javascript" src="/ueditor/third-party/template.min.js"></script>
    <script type="text/javascript" src="/ueditor/umeditor.config.js"></script>
    <style type="text/css">
        @keyframes animate_dots {
            0% {
                opacity: 1
            }
            to {
                opacity: 0
            }
        }

        @-webkit-keyframes animate_dots {
            0% {
                opacity: 1
            }
            to {
                opacity: 0
            }
        }

        .dot0, .dot1 {
            animation: animate_dots .9s infinite;
            -moz-animation: animate_dots .9s infinite;
            -webkit-animation: animate_dots .9s infinite;
            -o-animation: animate_dots .9s infinite
        }

        .dot1 {
            animation-delay: .2s;
            -webkit-animation-delay: .2s
        }

        .dot2 {
            animation: animate_dots .9s infinite;
            -moz-animation: animate_dots .9s infinite;
            -webkit-animation: animate_dots .9s infinite;
            -o-animation: animate_dots .9s infinite;
            animation-delay: .4s;
            -webkit-animation-delay: .4s
        }

        .dots_item {
            display: inline-block;
            margin-right: 5px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #4886ff
        }

        .verify-icon {
            position: absolute;
            width: 100%;
            margin-top: 70px;
            text-align: center
        }

        .t-mask {
            width: 100%;
            height: 100%;
            position: fixed;
            _position: absolute;
            left: 0;
            top: 0;
            background: #000;
            opacity: .5;
            filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
            z-index: 2000000000
        }</style>
    <style>
        .rheader .rlogo a, .step_list li em, .zcys_con dl dt, .reg_ok dl dt {
            background: url(/imgs/regico.png) no-repeat;
        }

        em {
            font-style: normal;
        }

        .register_steps {
            padding-top: 50px;
        }

        .reg_steps_b {
            position: relative;
            height: 60px;
            width: 990px;
            margin: 50px auto;
            overflow: hidden;
        }

        .step_list {
            position: absolute;
            Z-index: 9;
            width: 840px;
            top: 0px;
            left: 75px;
        }

        .step_list li {
            float: left;
            width: 170px;
            margin-left: 40px;
            _display: inline;
        }

        .step_list li em {
            display: block;
            height: 22px;
            width: 22px;
            line-height: 22px;
            background-position: 0 -33px;
            margin: 0 auto;
            text-align: center;
            color: #fff;
        }

        .step_list li p {
            line-height: 40px;
            color: #919191;
            text-align: center;
            font-size: 14px;
        }

        .step_list li.current em {
            background-position: 0 -11px;
            width: 170px;
        }

        .step_list li.current p {
            color: #fe7342;
        }

        .reg_steps_b i {
            display: block;
            width: 100%;
            height: 2px;
            background: #e4e4e4;
            position: absolute;
            left: 0px;
            top: 10px;
            z-index: 1;
            overflow: hidden;
        }

        .spw-cont .spw-tit {
            padding: 0 40px;
            height: 50px;
            line-height: 50px;
            border-bottom: 1px solid #f2f2f2;
        }

        .spw-cont .spw-tit h1 {
            font-size: 18px;
            color: #555;
            font-weight: bold;
        }

        .spw-cont .spw-mian {
            width: 420px;
            margin: 50px auto 0;
            position: relative;
        }

        .spw-cont .spw-mian .spw-icon {
            width: 80px;
            height: 80px;
            display: block;
            position: absolute;
            left: 0;
            top: 0;
            background: url(/static/imgs/pprompt-icon.png) no-repeat;
        }

        .spw-cont .spw-mian .spw-info {
            padding-left: 100px;
        }

        .spw-cont .spw-mian .spw-info h2 {
            font-size: 24px;
            font-weight: bold;
        }

        .spw-cont .spw-mian .spw-info .spw-txt {
            font-size: 14px;
            color: #8c8c8c;
            overflow: hidden;
        }

        .spw-cont .spw-mian .spw-info .spw-txt p {
            margin: 12px 0 8px;
        }

        .spw-cont .spw-mian .spw-info .spw-txt span {
            display: block;
            line-height: 24px;
        }

        .spw-cont .spw-mian .spw-info .spw-txt em {
            color: #333;
        }

        .spw-cont .spw-mian .spw-info .spw-txt .tag {
            border: 1px solid #d2d2d2;
            background-color: #f5f9fc;
            height: 23px;
            padding: 0 5px;
            color: #555;
            display: block;
            float: left;
            margin: 0 7px 5px 0;
        }

        .spw-cont .spw-mian .spw-info .spw-btn {
            margin-top: 12px;
        }

        .spw-cont .spw-mian .spw-info .spw-btn .btn {
            width: 138px;
            height: 38px;
            padding: 0;
            text-align: center;
            line-height: 38px;
            font-size: 14px;
        }

        .spw-cont .spw-success .spw-icon {
            background-position: 0 0;
        }

        .spw-cont .spw-success h2 {
            color: #4bc696;
        }

        .spw-cont .spw-fail .spw-icon {
            background-position: -85px 0;
        }

        .spw-cont .spw-fail h2 {
            color: #24be00;
        }

        .spw-cont .spw-wait .spw-icon {
            background-position: -169px 0;
        }

        .spw-cont .spw-wait h2 {
            color: #ff8f23;
        }
    </style>
    <style>
        .my-menu .curr {
            background-color: #19be6b;
        }

        .my-menu .curr a {
            color: #fff;
        }

        .my-menu li a {
            font-size: 13px;
            font-family: "Microsoft YaHei", "微软雅黑";
            display: block;
            line-height: 36px;
            margin-top: 1px;
        }

        .my-menu li:hover {
            background-color: #19be5b;
        }

        .my-menu li a:hover {
            color: #fff;
        }

        .mem-rz ul li.cur:nth-child(1) {
            background-position: 0px -42px;
        }

        .mem-rz ul li:nth-child(1) {
            background-position: 0px -130px;
        }

        .mem-rz ul li {
            width: 30px;
            height: 30px;
            margin: 0px 15px 0px 0px;
            float: left;
        }

        .mem-rz ul li, .qua-top .qua-ico {
            background: url(/imgs/member-ico.png) no-repeat;
        }

        ol, ul, li, p, h1, h5, h2, h3, h4, h6 {
            list-style: none;
            margin: 0px;
            padding: 0px;
        }

        .member .mem-rz ul li.cur:nth-child(1) {
            background-position: 0px -42px;
        }

        .member .mem-rz ul li.cur:nth-child(2) {
            background-position: -40px -42px;
        }

        .member .mem-rz ul li.cur:nth-child(3) {
            background-position: -80px -42px;
        }

        .member .mem-rz ul li.cur:nth-child(4) {
            background-position: -120px -42px;
        }

        .member .mem-rz ul li:nth-child(1) {
            background-position: 0px -92px;
        }

        .member .mem-rz ul li:nth-child(2) {
            background-position: -40px -92px;
        }

        .member .mem-rz ul li:nth-child(3) {
            background-position: -80px -92px;
        }

        .member .mem-rz ul li:nth-child(4) {
            background-position: -120px -92px;
        }

    </style>
</head>
<body class="main">

<{include file="public/header.html"}>

<div id="main" class="layui-main">
    <div class="layout-main clearfix">

        <{include file="public/sidebar.html"}>

        <div class="my-content">
            <div class="wrap">
                <div class="my-nav">
                    <span class="title">发布信息</span>
                </div>
                <div class="security-item-list">
                    <div class="qualification clearfix">
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <ul>
                                    <li class="clearfix">
                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><i class="red">*</i>标题</label>
                                            <div class="layui-input-block">
                                                <input class="layui-input" type="text" v-model="params.title" lay-verify="required" placeholder="请填写信息标题" style="width: 400px;">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><i class="red">*</i>分类</label>
                                            <div class="layui-input-block">
                                                <select class="selet" v-model="params.cat_level1"  @change="alterCat1" data-val="true" data-val-number="字段 所属行业 必须是一个数字。" data-val-required="请选择所属行业">
                                                    <option value="">请选择所属行业</option>
                                                    <option v-for="(vo, index) in catalog1" :value="index">{{vo}}</option>
                                                </select>
                                                <select v-if="!empty(catalog2)" class="selet" v-model="params.cat_level2"  @change="alterCat2" data-val="true" data-val-number="字段 所属行业 必须是一个数字。" data-val-required="请选择所属行业">
                                                    <option value="">请选择所属行业</option>
                                                    <option v-for="(vo, index) in catalog2" :value="index">{{vo}}</option>
                                                </select>
                                                <select v-if="!empty(catalog3)"  class="selet" v-model="params.cat_level3"  data-val="true" data-val-number="字段 所属行业 必须是一个数字。" data-val-required="请选择所属行业">
                                                    <option value="">请选择所属行业</option>
                                                    <option v-for="(vo, index) in catalog3" :value="index">{{vo}}</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label"><i class="red"></i>单价</label>
                                            <div class="layui-input-block">
                                                <input class="layui-input" type="text"  v-model="params.price"  lay-verify="required" placeholder="请填写产品报价" style="width: 400px;">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">参数</label>
                                            <div class="layui-input-block">
                                                <button style="margin: 0;" @click="params.params.push({name:'', value:''})" class="borange">添加参数</button>
                                                <div style="display: flex;width: 80%; padding-top: 5px;" v-for="(vo, index) in params.params">
                                                    <input class="layui-input" placeholder="参数名" type="text" v-model="vo.name" style="flex: 1">
                                                    <span style="padding: 5px;font-weight: bolder;color: #999;"> : </span>
                                                    <input class="layui-input" placeholder="参数值" type="text" v-model="vo.value" style="flex: 2;">
                                                    <i @click="params.params.splice(index, 1);" class="layui-icon layui-icon-reduce-circle"></i>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="ke-container ke-container-default">
                                                <label class="layui-form-label">详细描述</label>
                                                <div class="layui-input-block">
                                                    <script id="issueEditor" name="content" style="min-height: 400px;" type="text/plain"></script>
                                                    <div class="input-tip" style="color: #aaa; font-size: 13px;line-height: 28px;">详细的产品描述信息，如特性、用途、价格、质保、市场等与主题相关的内容，最少50字。如何填写产品详情</div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">关键词</label>
                                            <div class="layui-input-block">
                                                <input class="layui-input" v-model="params.keywords" data-val="true" data-val-length="最长100个字符" data-val-length-max="100" name="EnterpriseNetUrl" placeholder="请输入产品关键词,逗号间隔" type="text" value="" style="width: 400px;">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label"></label>
                                            <div class="layui-input-block">
                                                <button class="layui-btn" @click="submit">立即发布</button>
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<{include file="public/footer.html"}>

<script>
    var vm = new Vue({
        el: '#main',
        data: {
            catalog1: JSON.parse('<{addslashes($catalog1)}>'),
            catalog2: JSON.parse('<{addslashes($catalog2)}>'),
            catalog3: JSON.parse('<{addslashes($catalog3)}>'),
            params: JSON.parse('<{addslashes($params)}>'),
        },
        methods: {
            init() {
                UM.getEditor('issueEditor').ready(function () {
                    this.setContent(vm.params.detail);
                });
            },
            alterCat1(){
                ajax(GetCat_url, {up: vm.params.cat_level1}).then((data)=>{
                    vm.catalog2 = data.data;
                    vm.catalog3 = {};
                });
            },
            alterCat2(){
                ajax(GetCat_url, {up: vm.params.cat_level2}).then((data)=>{
                    vm.catalog3 = data.data;
                });
            },
            submit() {
                if(empty(vm.params.title.trim())){
                    layer.msg("请输入标题");
                    return false;
                }
                if(!vm.params.cat_level2){
                    layer.msg("请至少选择到第二分类");
                    return false;
                }
                vm.params.detail = UM.getEditor('issueEditor').getContent();
                if(empty(vm.params.detail.trim())){
                    layer.msg("请输入内容描述");
                    return false;
                }
                ajax(Issue_url, vm.params, true, true).then((data) => {
                    if (data.ret === 0) {
                        setTimeout(() => {
                            location.reload();
                        }, 1500);
                    }
                });
            }
        }
    });
    vm.init();
</script>
</body>
</html>
